package api_day06;

import java.util.*;

public class TestDemo {
    public static void main(String[] args) {
        /*//约瑟夫环测试题
        List<Integer> list = new ArrayList<>(10);
        for (int i = 1; i < 11; i++) {
            list.add(i);
        }
        //思路：前两次每次先删除第一位，然后存储被删除元素再添加到尾部，第三次才删除
        while (list.size() > 1){
            for (int i = 0; i < 2; i++) {
                Integer remove = list.remove(0);
                list.add(remove);
            }
            list.remove(0);
        }
        System.out.println(list);*/

        /*//Deque接口的测试
        Deque deque = new LinkedList();
        deque.offer(1);
        deque.offer(2);
        deque.offer(3);
        System.out.println(deque);
        deque.offer(4);
        deque.offer(5);
        System.out.println(deque);
        System.out.println(deque.peek());
        System.out.println(deque.poll());
        System.out.println(deque);*/

        //comparable测试
        Student stu1 = new Student("张三",18);
        Student stu2 = new Student("李四",18);
        Student stu3 = new Student("王五",20);
        Student stu4 = new Student("张三",20);
        TreeSet ts = new TreeSet();
        ts.add(stu1);
        ts.add(stu2);
        ts.add(stu3);
        ts.add(stu4);
        System.out.println(ts);
    }
}
